/**
 * @file InetAddress.h
 * @author your name (you@domain.com)
 * @brief
 * @version 0.1
 * @date 2022-04-05
 *
 * @copyright Copyright (c) 2022
 *
 */

#pragma once

#include <netinet/in.h>
#include <string>

namespace wd
{

class InetAddress
{
  public:
    explicit InetAddress(short port);
    InetAddress(const char *pIp, short port);
    InetAddress(const struct sockaddr_in &addr);

    const struct sockaddr_in *getSockAddrPtr() const;
    std::string ip() const;
    unsigned short port() const;

  private:
    struct sockaddr_in addr_;
};

} // end of namespace wd
